
//鏃堕棿鍊掓暟
var time_count_down;
function L_count_time()
{
	if(document.getElementById("sp_seconds"))
	{
		var o_second=document.getElementById("sp_seconds");
		var o_minute=document.getElementById("sp_minutes");
		var o_hour=document.getElementById("sp_hours");
		var o_day=document.getElementById("sp_days");

		var second=parseInt(o_second.innerHTML);
		var minute=parseInt(o_minute.innerHTML);
		var hour=parseInt(o_hour.innerHTML);
		var day=parseInt(o_day.innerHTML);
		

		if(0<second)
		{
			second-=1;
			o_second.innerHTML=second;
		}
		else
		{
			second=minute==0?0:59;
			o_second.innerHTML=second;
			if(0<minute)
			{	
				minute-=1;
				o_minute.innerHTML=minute;
			}
			else
			{
				
				minute=hour==0?0:59;
				o_minute.innerHTML=minute;
				if(0<hour)
				{	
					hour-=1;
					o_hour.innerHTML=hour;
				}
				else
				{
					if(0<day)
					{	
						hour=23;
						day-=1;
						o_day.innerHTML=day;
						o_hour.innerHTML=hour;
					}
					else
					{	
						o_day.innerHTML="0";
						o_hour.innerHTML="0";
					}
				}
			}
		}

		
	}
	else
		clearInterval(time_count_down);

	if(second==0&&minute==0&&hour==0&&day==0)
		clearInterval(time_count_down);

}

function mer_time_init() {
	var brand_end_time, b_d, b_h, b_m;
	brand_end_time = mer_time_info - brand_adjust_time;
	b_d = Math.floor(brand_end_time/86400);
	b_h = Math.ceil(brand_end_time/(3600))-b_d*24-1;
	b_m = Math.floor((brand_end_time-b_d*86400-b_h*3600)/60);
	$('sp_days').innerHTML = b_d;
	$('sp_hours').innerHTML = b_h;
	$('sp_minutes').innerHTML = b_m;
	$('sp_seconds').innerHTML = '60';

	init_count();
}

function init_count()
{
	time_count_down=setInterval(L_count_time,1000);
}